
# OOP 三大特征
# 1. 封装 encapsulation
# 2. 继承 inheritance
# 3.多态 polymorphism

class Student:
    def __init__(self,n=None,s=0):
        self.__name = n  #对象属性
        self.__score = int(s)

    # def getName(self):
    #    return self.__name

    @property
    def name(self):
       return self.__name

    @property
    def score(self):
        return self.__score

    @score.setter
    def score(self,score):
        if type(score) == int:
            self.__score = score
        else:
            print("input again")

    # def set_score(self,score):
    #     if type(score) == int:
    #         self.__score = score
    #     else:
    #         print("input again")

if __name__ == '__main__':
    marvin = Student("marvin",90) #Object instance
    print(marvin.name)
    marvin.score = "zwb"
    print(marvin.score)




